#include <iostream>
#include "ClassFactory.h"
#include "A.h"

using namespace std;

int main()
{
    ClassFactory * factory = Singleton<ClassFactory>::instance();

    Object * a = factory->create_class("A");
    a->set("m_age", 18);
    int age;
    a->get("m_age", age);
    cout << "age: " << age << endl;

    int count = a->get_field_count();
    for (int i = 0; i < count; i++)
    {
        ClassField * field = a->get_field(i);
        cout << field->name() << ", " << field->type() << ", " << field->offset() << endl;
    }

    return 0;
}